<#macro head title="">
    <!DOCTYPE html>
    <html>

    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
        <title>${title}</title>
        <link rel="stylesheet" href="${rc.contextPath}/plugins/layui/css/layui.css">
        <link rel="stylesheet" href="${rc.contextPath}/css/style.css">
        <#nested />
    </head>
</#macro>
<#macro body menu="">

    <body class="layui-layout-body">
        <div class="layui-layout layui-layout-admin">
            <div class="layui-header">
                <div class="layui-logo">测试模板系统</div>
                <ul class="layui-nav layui-layout-left">
                    <li class="layui-nav-item"><a id="currentMenuLoaction" href=""></a></li>
                </ul>
                <ul class="layui-nav layui-layout-right">
                    <li class="layui-nav-item">
                        <a href="javascript:;">
                            <img src="${rc.contextPath}/images/favicon.ico" class="layui-nav-img">
                            ${Session.userUsername}
                        </a>
                        <dl class="layui-nav-child">
                            <dd><a href="">基本资料</a></dd>
                            <dd><a href="">安全设置</a></dd>
                        </dl>
                    </li>
                    <li class="layui-nav-item"><a href="${rc.contextPath}/logout">退出</a></li>
                </ul>
            </div>

            <div class="layui-side layui-bg-black">
                <div class="layui-side-scroll">
                    <ul class="layui-nav layui-nav-tree" lay-filter="test">
                        <li class="layui-nav-item ${(menu=='form')?then('layui-this','')}"><a
                                href="${rc.contextPath}/admin/">表单</a></li>
                        <li class="layui-nav-item ${(menu=='table')?then('layui-this','')}"><a
                                href="${rc.contextPath}/admin/table">表格</a></li>
                        <li class="layui-nav-item layui-nav-itemed">
                            <a class="" href="javascript:;">下拉菜单</a>
                            <dl class="layui-nav-child">
                                <dd class="${(menu=='list1')?then('layui-this','')}"><a href="javascript:;">列表一</a></dd>
                                <dd class="${(menu=='list2')?then('layui-this','')}"><a href="javascript:;">列表二</a></dd>
                                <dd class="${(menu=='list3')?then('layui-this','')}"><a href="javascript:;">列表三</a></dd>
                                <dd class="${(menu=='href')?then('layui-this','')}"><a href="">超链接</a></dd>
                            </dl>
                        </li>
                    </ul>
                </div>
            </div>

            <div class="layui-body">
                <div style="padding: 15px;">
                    <#if currentBreadCrumb??>
                        <div class="layui-breadcrumb" style="margin-bottom: 10px;">
                            <#list currentBreadCrumb.breadCrumbs as key,value>
                                <a href="${rc.contextPath}${value}">
                                    <#if key==currentBreadCrumb.currentLabel>
                                        <cite>${key?replace('&nbsp;','')}</cite>
                                        <#else>
                                            ${key}
                                    </#if>
                                </a>
                            </#list>
                        </div>
                    </#if>
                    <#nested />
                </div>
            </div>

            <div class="layui-footer">
                
            </div>
        </div>
</#macro>
<#macro script>
    <script src="${rc.contextPath}/js/jquery-1.12.4.min.js"></script>
    <script src="${rc.contextPath}/js/jquery.form.min.js"></script>
    <script src="${rc.contextPath}/js/moment-2.22.1.min.js"></script>
    <script src="${rc.contextPath}/plugins/layui/layui.all.js"></script>
    <script src="${rc.contextPath}/plugins/lodash/4.17.11/lodash.min.js"></script>
    <script src="${rc.contextPath}/plugins/decimal.js/10.2.0/decimal.min.js"></script>
    <script>
        $(function () {
            var $currentMenuLoaction = $('#currentMenuLoaction');
            var $menu = $('.layui-side .layui-this');
            if ($menu.length > 0) {
                $currentMenuLoaction.text($menu.text());
                $currentMenuLoaction.attr('href', $menu.attr('href'));
            }
        });
    </script>
    <script>
        (function ($) {
            $.handlerResult = function (options) {
                var result = options.result;
                if (result.code == 200) {
                    var success = options.success;
                    if (success !== undefined) {
                        success(result.message, result.data);
                    } else {
                        showPnotify('success', result.message);
                    }
                } else if (result.code == 400) {
                    var fail = options.fail;
                    if (fail !== undefined) {
                        fail(result.message, result.data);
                    } else {
                        showPnotify('notice', result.message);
                    }
                }
            };
        })(jQuery);
    </script>
    <#nested />
    </body>

    </html>
</#macro>